#ifndef _PWM_H
#define _PWM_H
// Maximum PWM resolution(10bits) with 8MHz oscillator is 7500Hz
// from datasheet -> log(8000000/7500)/log(2) = 10.0588937

// PR2 = (1/(PWM Frequency*FCY*TMR2 presccale)) - 1
// PR2 = (1/(20000*.0000005*1))-1 = 99
#define PWMFrequency(pwm_freq) PR2 = ( 1 / (pwm_freq * TCY * TMR2_PRE)) - 1

void InitPWM(void);
void PWMDutyCycle(int);

#endif

